using System.Threading.Tasks;

namespace Commons
{
	/// <summary>
	/// Encapsulates stream read/write progress information
	/// </summary>
	public class StreamProgressEventArgs : ProgressEventArgs
	{
		/// <summary>
		/// Initializes the <see cref="StreamProgressEventArgs"/>
		/// </summary>
		/// <param name="length">The total length of the stream</param>
		/// <param name="read">The number of bytes already read</param>
		/// <param name="message">An optional progress message</param>
		public StreamProgressEventArgs(long length, long read, string message = "")
			: base((int)(read / length * 100), message)
		{
			StreamLength = length;
			BytesRead = read;
		}

		/// <summary>
		/// The total length of the stream
		/// </summary>
		public long StreamLength { get; private set; }

		/// <summary>
		/// The number of bytes already read
		/// </summary>
		public long BytesRead { get; private set; }
	}
}
